﻿using System;
using UnityEngine;
using DG.Tweening;

[CreateAssetMenu(fileName = "FadeAlphaOnEnter", menuName = "Asset/LoadSceneScreenFX/FadeAlphaOnEnter")]
public class FadeAlphaOnEnter : CommandLogicSOBase
{
    protected override void OnExecute(Action doneCB, object param = null)
    {
        var window = GameRoot.Instance.uIService.PopWindow<AlphaMaskWindow>();
        window.ResetSetScreenAlphaMask(new Vector3(0, 0, 0), 1);
        Tween tween = window.windowComp.BgRawImage.DOFade(0, 3.5f).SetDelay(1f).SetEase(Ease.InOutQuad).OnComplete(() => { doneCB?.Invoke(); });
    }
}